package com.cyzy.openfeign;

import com.cyzy.dto.ResponseDto;
import com.cyzy.openfeign.factory.DriverOpenFeignFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

//           关联到哪个微服务         关联到哪个controller
@FeignClient(name = "driver-service",path = "/driver",fallbackFactory = DriverOpenFeignFactory.class)
public interface DriverOpenFeign {
    @GetMapping("/getDriverType")
    ResponseDto getDriverType(@RequestParam("driverId") int driverId);

    @PutMapping("/updateDriverTakingStatus")
    ResponseDto updateDriverTakingStatus(@RequestParam("driverId") int driverId,@RequestParam("takingStatus") int takingStatus);

    @PostMapping("/automaticOrder")
    ResponseDto automaticOrder(@RequestParam("orderId") Long orderId);
}
